<div id="content" style="position: relative;min-height: 100%;">
	<div id="fix_overflow" style="overflow: initial;">
		<div class="row s_page_title">
			<sa-big-breadcrumbs [items]="['运维管理[环卫]','故障问题统计']" icon="fa fa-newspaper-o" class="col-xs-12 col-sm-7 col-md-7 col-lg-4"></sa-big-breadcrumbs>
		</div>
		<sa-widgets-grid>
			<div class="s_table">
				<div sa-widget [editbutton]="false" color="darken" class="clearfix">
					<header><span class="widget-icon"> <i class="fa fa-table"></i> </span><h2>故障问题统计</h2></header>
					<div>
						<div class="widget-body no-padding">
							<div class="page-header clearfix s_table_opreation" style="position: relative;">
								<div class="left page-header-btn" style="width: calc(100% - 220px);">
									<div class="top_module">
										<span class="module_text">公司名称</span>
										<sa-company-tree companyTreeId="companyTree" (companySelected)="companySelected($event)"></sa-company-tree>
									</div>
									<div class="top_module top_module_box">
										<span class="module_text">选择时间</span>
										<input type="text" class="module_inp top_module_select form-control" id="startTimePicker" autocomplete="off" [(ngModel)]="startTime_table" placeholder="时间"/>
									</div>
									<button type="button" class="btn btn-primary" (click)="table_search()">查询</button>
									<button class="btn btn-primary" type="button" (click)="exportReport()">导出</button>
								</div>
								<!-- <div class="right top-search" style="width:220px">
									<input type="text" [(ngModel)]="searchKey" (change)="table_search()" class="search-input" placeholder="项目名称">
									<span class="top-search-box">
										<button class="top-search-btn" type="button" (click)="table_search()"> <i class="fa fa-search"></i></button>
									</span>
								</div> -->
							</div>
							<div class="">
								<ul class="nav nav-tabs" id="myTab" style="padding-left:12px;background-image: linear-gradient(#F1F5FD, #E9F0FF);padding: 0;">
									<li class="active s-lis"><a data-toggle="tab" href="#repairCount" (click)="btnClick('repairCount')">车辆问题统计&nbsp;&nbsp;</a></li>
									<li class="s-lis"><a data-toggle="tab" href="#sensorProblem" (click)="btnClick('sensorProblem')">传感器问题统计&nbsp;&nbsp;</a></li>
									<li class="s-lis"><a data-toggle="tab" href="#gpsProblem" (click)="btnClick('gpsProblem')">GPS问题统计&nbsp;&nbsp;</a></li>
								</ul>
							</div>
							<div class="table_scroll">
								<table class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
									<thead>
										<tr>
											<th>公司名称</th>
											<th *ngIf="btnNum == 'repairCount'">
												<span>传感器问题/总计</span>
												<span class="sort-icon">
													<i class="fa  fa-caret-left" [ngClass]="{active:columnSortFlag == 'sensorProblemTotalNumAsc'}" (click)="columnSort('sensorProblemTotalNumAsc')"></i>
													<i class="fa  fa-caret-right" [ngClass]="{active:columnSortFlag == 'sensorProblemTotalNumDesc'}" (click)="columnSort('sensorProblemTotalNumDesc')"></i>
												</span>
											</th>
											<th *ngIf="btnNum == 'repairCount'">
												<span>GPS问题/总计</span>
												<span class="sort-icon">
													<i class="fa  fa-caret-left" [ngClass]="{active:columnSortFlag == 'gpsProblemTotalNumAsc'}" (click)="columnSort('gpsProblemTotalNumAsc')"></i>
													<i class="fa  fa-caret-right" [ngClass]="{active:columnSortFlag == 'gpsProblemTotalNumDesc'}" (click)="columnSort('gpsProblemTotalNumDesc')"></i>
												</span>
											</th>
											<th *ngIf="btnNum == 'repairCount'">
												<span>问题车辆/总计</span>
												<span class="sort-icon">
													<i class="fa  fa-caret-left" [ngClass]="{active:columnSortFlag == 'problemCarTotalNumAsc'}" (click)="columnSort('problemCarTotalNumAsc')"></i>
													<i class="fa  fa-caret-right" [ngClass]="{active:columnSortFlag == 'problemCarTotalNumDesc'}" (click)="columnSort('problemCarTotalNumDesc')"></i>
												</span>
											</th>
											<th *ngIf="btnNum == 'repairCount'">车辆数/总计</th>
											<th *ngIf="btnNum == 'repairCount'">
												<span>故障率</span>
												<span class="sort-icon">
													<i class="fa  fa-caret-left" [ngClass]="{active:columnSortFlag == 'carFaultRateAsc'}" (click)="columnSort('carFaultRateAsc')"></i>
													<i class="fa  fa-caret-right" [ngClass]="{active:columnSortFlag == 'carFaultRateDesc'}" (click)="columnSort('carFaultRateDesc')"></i>
												</span>
											</th>
											
											<th *ngIf="btnNum == 'sensorProblem'">正负52万</th>
											<th *ngIf="btnNum == 'sensorProblem'">经常52万</th>
											<th *ngIf="btnNum == 'sensorProblem'">偶尔52万</th>
											<th *ngIf="btnNum == 'sensorProblem'">乱跳</th>
											<th *ngIf="btnNum == 'sensorProblem'">形变小</th>
											<th *ngIf="btnNum == 'sensorProblem'">方向反</th>
											<th *ngIf="btnNum == 'sensorProblem'">平直</th>
											<th *ngIf="btnNum == 'sensorProblem'">
												<span>问题传感器</span>
												<span class="sort-icon">
													<i class="fa  fa-caret-left" [ngClass]="{active:columnSortFlag == 'totalProblemSensorNumAsc'}" (click)="columnSort('totalProblemSensorNumAsc')"></i>
													<i class="fa  fa-caret-right" [ngClass]="{active:columnSortFlag == 'totalProblemSensorNumDesc'}" (click)="columnSort('totalProblemSensorNumDesc')"></i>
												</span>
											</th>
											<th *ngIf="btnNum == 'sensorProblem'">传感器总数</th>
											<th *ngIf="btnNum == 'sensorProblem'">
												<span>故障率</span>
												<span class="sort-icon">
													<i class="fa  fa-caret-left" [ngClass]="{active:columnSortFlag == 'sensorFaultRateAsc'}" (click)="columnSort('sensorFaultRateAsc')"></i>
													<i class="fa  fa-caret-right" [ngClass]="{active:columnSortFlag == 'sensorFaultRateDesc'}" (click)="columnSort('sensorFaultRateDesc')"></i>
												</span>
											</th>

											<th *ngIf="btnNum == 'gpsProblem'">无GPS数据</th>
											<th *ngIf="btnNum == 'gpsProblem'">停车速度平直</th>
											<th *ngIf="btnNum == 'gpsProblem'">数据大段丢失</th>
											<th *ngIf="btnNum == 'gpsProblem'">数据偶尔丢失</th>
											<th *ngIf="btnNum == 'gpsProblem'">
												<span>问题GPS设备</span>
												<span class="sort-icon">
													<i class="fa  fa-caret-left" [ngClass]="{active:columnSortFlag == 'totalProblemGpsNumAsc'}" (click)="columnSort('totalProblemGpsNumAsc')"></i>
													<i class="fa  fa-caret-right" [ngClass]="{active:columnSortFlag == 'totalProblemGpsNumDesc'}" (click)="columnSort('totalProblemGpsNumDesc')"></i>
												</span>
											</th>
											<th *ngIf="btnNum == 'gpsProblem'">GPS设备总数</th>
											<th *ngIf="btnNum == 'gpsProblem'">
												<span>故障率</span>
												<span class="sort-icon">
													<i class="fa  fa-caret-left" [ngClass]="{active:columnSortFlag == 'gpsFaultRateAsc'}" (click)="columnSort('gpsFaultRateAsc')"></i>
													<i class="fa  fa-caret-right" [ngClass]="{active:columnSortFlag == 'gpsFaultRateDesc'}" (click)="columnSort('gpsFaultRateDesc')"></i>
												</span>
											</th>
										</tr>
									</thead>
									<tbody>
										<tr *ngFor="let row of tableData; let i = index" [attr.data-index]="i">
											<td>{{row.companyName}}</td>

											<td *ngIf="btnNum == 'repairCount'">{{row.sensorProblemTotalNum}}</td>
											<td *ngIf="btnNum == 'repairCount'">{{row.gpsProblemTotalNum}}</td>
											<td *ngIf="btnNum == 'repairCount'">{{row.problemCarTotalNum}}</td>
											<td *ngIf="btnNum == 'repairCount'"><a (click)="Jump(row)" style="color: blue;">{{row.carTotalNum}}</a></td>
											<td *ngIf="btnNum == 'repairCount'">{{row.carFaultRate}}%</td>

											<td *ngIf="btnNum == 'sensorProblem'">{{row.panNum}}</td>
											<td *ngIf="btnNum == 'sensorProblem'">{{row.usualPanNum}}</td>
											<td *ngIf="btnNum == 'sensorProblem'">{{row.occasionallyPanNum}}</td>
											<td *ngIf="btnNum == 'sensorProblem'">{{row.jumpNum}}</td>
											<td *ngIf="btnNum == 'sensorProblem'">{{row.smallDeformationNum}}</td>
											<td *ngIf="btnNum == 'sensorProblem'">{{row.oppositeNum}}</td>
											<td *ngIf="btnNum == 'sensorProblem'">{{row.straightnessNum}}</td>
											<td *ngIf="btnNum == 'sensorProblem'"><a (click)="Jump(row)" style="color: blue;">{{row.totalProblemSensorNum}}</a></td>
											<td *ngIf="btnNum == 'sensorProblem'">{{row.totalSensorNum}}</td>
											<td *ngIf="btnNum == 'sensorProblem'">{{row.sensorFaultRate}}%</td>

											<td *ngIf="btnNum == 'gpsProblem'">{{row.noGpsNum}}</td>
											<td *ngIf="btnNum == 'gpsProblem'">{{row.speedStraightnessNum}}</td>
											<td *ngIf="btnNum == 'gpsProblem'">{{row.gpsLoseLargeNum}}</td>
											<td *ngIf="btnNum == 'gpsProblem'">{{row.gpsLoseOccasionallyNum}}</td>
											<td *ngIf="btnNum == 'gpsProblem'"><a (click)="Jump(row)" style="color: blue;">{{row.totalProblemGpsNum}}</a></td>
											<td *ngIf="btnNum == 'gpsProblem'">{{row.totalGpsNum}}</td>
											<td *ngIf="btnNum == 'gpsProblem'">{{row.gpsFaultRate}}%</td>
										</tr>
									</tbody>
								</table>
							</div>
							<div class="table-fix clearfix">
								<paginator [totalRecords]="totalCounts"
							           [rows]="pageSize"
							           [currentPage]="curPage - 1"
							           (onPageChange)="paginate($event)">
								</paginator>
								<button type="button" class="btn default refresh_btn" (click)="refresh()"><i class="fa fa-refresh"></i></button>
							</div>
						</div>
					</div>
				</div>
			</div>
		</sa-widgets-grid>
	</div>
</div>
<style>
	.TimeSuggest{
		width: 390px;
		height: 28px;
		position: relative;
		top: 0px;
		left: 2px;
	}
</style>

